import { Reflector } from './Reflector';
import { PlaneBufferGeometry, Color } from 'three';
const useRflector = (config) => {
  config = Object.assign({
    w: 1000,
    h: 1000,
    color: new Color(0xffffff),
    rotation: [0, 0, 0]
  }, config)
  const reflectPlane = new PlaneBufferGeometry(config.w, config.h);
  const reflect = new Reflector(reflectPlane, {
    clipBias: 0.03,
    textureWidth: window.innerWidth * window.devicePixelRatio,
    textureHeight: window.innerHeight * window.devicePixelRatio,
    color: config.color,
  });
  reflect.rotation.set(...config.rotation);
  return reflect;
}
export { useRflector };
